 <template>
 	<view>
 		<scientific v-if="PageCur=='scientific'"></scientific>
 		<product v-if="PageCur=='product'"></product>
 		<clinical v-if="PageCur=='clinical'"></clinical>
 		<therepair v-if="PageCur=='therepair'"></therepair>
 		
 		<view class="cu-bar tabbar bg-white shadow foot">
 			<view class="action" @click="NavChange" data-cur="scientific">
 				<view class='cuIcon-cu-image'>
 					<!-- <image :src="'/static/tabbar/basics' + [PageCur=='scientific'?'_cur':''] + '.png'"></image> -->
					<view :class="['t-icon',PageCur=='scientific'?'t-icon-dongwutubiao-shangse-huli':'t-icon-dongwutubiao-xianxing-huli']"></view>
 				</view>
 				<view :class="PageCur=='scientific'?'text-green':'text-gray'">科学认证</view>
 			</view>
 			<view class="action" @click="NavChange" data-cur="product">
 				<view class='cuIcon-cu-image'>
 					<!-- <image :src="'/static/tabbar/component' + [PageCur == 'product'?'_cur':''] + '.png'"></image> -->
					<view :class="['t-icon',PageCur=='product'?'t-icon-dongwutubiao-shangse-niu':'t-icon-dongwutubiao-xianxing-niu']"></view>
 				</view>
 				<view :class="PageCur=='product'?'text-green':'text-gray'">产品介绍</view>
 			</view>
 			<view class="action" @click="NavChange" data-cur="clinical">
 				<view class='cuIcon-cu-image'>
 					<!-- <image :src="'/static/tabbar/plugin' + [PageCur == 'clinical'?'_cur':''] + '.png'"></image> -->
					<view :class="['t-icon',PageCur=='clinical'?'t-icon-dongwutubiao-shangse-shizi':'t-icon-dongwutubiao-xianxing-shizi']"></view>
 				</view>
 				<view :class="PageCur=='clinical'?'text-green':'text-gray'">临床内容</view>
 			</view>
 			<view class="action" @click="NavChange" data-cur="therepair">
 				<view class='cuIcon-cu-image'>
 					<!-- <image :src="'/static/tabbar/plugin' + [PageCur == 'therepair'?'_cur':''] + '.png'"></image> -->
					<view :class="['t-icon',PageCur=='therepair'?'t-icon-dongwutubiao-shangse-zhu':'t-icon-dongwutubiao-xianxing-zhu']"></view>
 				</view>
 				<view :class="PageCur=='therepair'?'text-green':'text-gray'">一键报修</view>
 			</view>
 		</view>
		
		<view class="cu-modal" :class="modalName=='Modal'?'show':''">
			<view class="cu-dialog"  >
				<view class="cu-bar bg-white justify-end">
					<view class="content text-bold">授权登录</view>
					<view class="action" @tap="hideModal">
						<text class="cuIcon-close text-red"></text>
					</view>
				</view>
				<view class="padding-xl">			
					<view class="cu-bar bg-white solid-bottom margin-top">
						<view class="action">
							<text class="cuIcon-title text-orange"></text> 申请获取以下权限
						</view>
					</view>

					<view class="cu-list menu" >
						<view class="cu-item" >
							<view class="content">
								<text class="text-grey">获得你的公开信息(昵称,头像,手机等)</text>
							</view>
						</view>
					</view>
					<button class="cu-btn block bg-green margin-tb-sm lg" open-type="getUserInfo" @getuserinfo="mpWxLogin">
						授权登录
					</button>		
				</view>
			</view>
		</view>
 	 <dragball :x='0' :y='70' image="http://pic27.nipic.com/20130321/9678987_225139671149_2.jpg"></dragball>
	</view>
 </template>
 
 <script>
	import loginMpWx from '@/common/oyyl-mixin/login-mp-wx.js'
	import dragball from "@/components/drag-ball/drag-ball.vue";
 	export default {
		mixins: [loginMpWx],
 		data() {
 		return {
 				PageCur: 'scientific',
				modalName: null,
 			}
 		},
		components: {
			dragball
		},
		onLoad() {
			console.log(this.$store.state.userInfo,"======this.$store.state.userInfo")
			if(JSON.stringify(this.$store.state.userInfo)==="{}"){
				this.modalName='Modal'
			}
			
		},
 		methods: {
 			NavChange: function(e) {
 				this.PageCur = e.currentTarget.dataset.cur
 			},
			hideModal(e) {
				this.modalName = null
			},
			showModal(e) {
				this.modalName = e.currentTarget.dataset.target
			},
 		}
 	}
 </script>
 
 <style>
 
 </style>
